package service;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import struts.action.Action;
import struts.form.ActionForm;
import animation.ActionAnotation;
import animation.ActionsAnotation;

public class SActionLogin implements Action{

	@Override
	@ActionsAnotation(path="/login",
	beanName="", 
	actionClass="service.SActionLogin",
	formClasss="service.SForm",
	mapurl={@ActionAnotation(name="shibai",value="/view/LoginFail.jsp"),@ActionAnotation(name="chenggong",value="/view/LoginOk.jsp")})
	public String execute(HttpServletRequest request, ActionForm form,
			Map<String, String> actionForward) {
		String url = "shibai";
				
		SForm myForm = (SForm)form;
		if(myForm.getName().equals("maogy")){
			url = "chenggong";
		}
		
		return actionForward.get(url);
	}


	
}
